mod core;
//use crate::core::tcp::TcpServer;
//use core::callback::CallbackHandler;
// use core::callback::CallbackStorage;
// use core::event::EventManager;
// use core::tcp::AsyncTcpClient;
// use core::tcp::client_send_package;
use core::tcp::{AsyncTcpServer};
use tokio::sync::mpsc;

use crate::core::callback::CallbackFunc;
//use core::server::TcpServer;
//use crate::core::server::ServerEvent;
// use crate::core::async_fn::AsyncCallFunc;
// use std::future::Future;
// use std::pin::Pin;

#[tokio::main]
async fn main() -> std::io::Result<()> {
    let mut run_chan = mpsc::channel::<u8>(100);

    println!("Hello, world!");

    let server = AsyncTcpServer::new();

    server
        .run_server("0.0.0.0:60000")
        .await;

    _ = run_chan.1.recv().await;
    Ok(())
}

// fn server_event(event: ServerEvent) {
//     println!("==>{:?}", event);
// }
